Skip to main content

Serverless Framework


Few notes when using Serverless Framework. https://youtu.be/uaEC4MK5ecE

Great Video Series on Using Serverless Framework

Quick start

Installation

https://www.serverless.com/framework/docs/providers/aws/guide/installation/

Setting up AWS CLI

https://www.serverless.com/framework/docs/providers/aws/guide/credentials#setup-with-the-aws-cli

Serverless tutorials:

https://www.serverless.com/learn/

Serverless examples:

https://www.serverless.com/examples/

serverless.yml

using variables

Full Guide here

Reference from env variables

stage: ${file(../env/config.${opt:stage, 'dev'}.json)}

This will cause serverless look in env config.(stage).json and if not use 'dev' as default. To have serverless look in the file specified, you must use sls deploy --stage dev to look in env/config.uat.config

To self-reference properties in serverless.yml

${self:someProperty}

CloudFront

DomainName

Make sure to follow formats listed here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistS3AndCustomOrigins.html

Plugins

serverless-finch : Plugin for deployment of static website assets of your Serverless project to AWS S3

Usage:

serverless client deploy --no-confirm